package cn.fourthquestion;

import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        PizzaFactory pizzaFactory = new PizzaFactory();
        while (true) {
            System.out.println("请选择需要制作的披萨（1.培根披萨  2.海鲜披萨）");
            int num = scanner.nextInt();
            if (num == 1) {
                System.out.println("请输入培根克数：");
                int kg = scanner.nextInt();
                System.out.println("请输入披萨大小：");
                int size = scanner.nextInt();
                System.out.println("请输入披萨价格：");
                double price = scanner.nextDouble();
                BaconPizza baconPizza = new BaconPizza("培根披萨", price, size, kg);
                pizzaFactory.show(baconPizza);
            } else if (num == 2) {
                System.out.println("请输入配料信息：");
                String dosing = scanner.next();
                System.out.println("请输入披萨大小：");
                int size = scanner.nextInt();
                System.out.println("请输入披萨价格：");
                double price = scanner.nextDouble();
                SeafoodPizza seafoodPizza = new SeafoodPizza("海鲜披萨", price, size, dosing);
                pizzaFactory.show(seafoodPizza);
            }
            System.out.println("是否继续制作披萨（0退出）");
            int N=scanner.nextInt();
            if (N==0){
                System.out.println("谢谢使用！");
                break;
            }
        }
    }
}
